﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RoadSign
{
    public partial class StartForm : Form
    {
        private Form1 form1;
        private static int totalTime = 1000;//3秒启动时间
        private int speed;
        public StartForm(Form1 form1)
        {
            InitializeComponent();
            this.form1 = form1;
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 100;
            this.speed = progressBar1.Maximum/(totalTime / timer1.Interval);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Value = progressBar1.Value + speed > progressBar1.Maximum ? progressBar1.Maximum : progressBar1.Value + speed;

            if (progressBar1.Value == progressBar1.Maximum)
            {
                form1.Visible = true;
                this.Dispose();
            }
        }
    }
}
